package com.wlyuan.gateway.exception;

import com.wlyuan.utils.ResultError;
import lombok.RequiredArgsConstructor;

/**
 * @author yuanzheng
 */
@RequiredArgsConstructor
public class AuthorizationError implements ResultError {
    private final int code;
    private final String message;

    public static final AuthorizationError TOKEN_INVALID = new AuthorizationError(401, "登录已失效");
    public static final AuthorizationError UNAUTHORIZED = new AuthorizationError(401, "用户未登录");
    public static final AuthorizationError FORBIDDEN = new AuthorizationError(403, "禁止访问");

    @Override
    public int getCode() {
        return code;
    }

    @Override
    public String getMessage() {
        return message;
    }
}
